package it.canraid.leaflet.control;

import it.canraid.leaflet.view.StatusMessageView;

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;

import android.app.Activity;
import android.content.Intent;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationProvider;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import android.widget.Toast;

public class ProviderGpsListener implements LocationListener {
	private GoogleMap map=null;
	private StatusMessageView statusView=null;
	
	public ProviderGpsListener(GoogleMap map, StatusMessageView statusView){
		this.map=map;
		this.statusView=statusView;
	}
	
	public void onLocationChanged(Location location) {
		double lon=location.getLongitude();
		double lat=location.getLatitude();
		double acc=location.getAccuracy();
		map.addMarker(new MarkerOptions().position(new LatLng(lat,lon)).title(acc+"m"));
	}

	public void onProviderDisabled(String provider) {}

	public void onProviderEnabled(String provider) {}

	public void onStatusChanged(String provider, int status, Bundle extras) {}
}
